<?php

class RegisterView {
	
	private $m_username = 'username';
	private $m_password = 'password';
	private $m_password2 = 'password2';
	private $m_registerButton = 'registerButton';
	
	
	
	public function RegisterUserBox(){
		return
		'<form method="post">
			    <fieldset>
					Name: <input type="text" name="'.$this->m_username.'" /><br />
					Password: <input type="text" name="'.$this->m_password.'" /><br />
					Verify Password: <input type="text" name="'.$this->m_password2.'" /><br />
					<input type="submit" value="Register" name="'.$this->m_registerButton.'"/>
				</fieldset>
		 </form>';
		
	}
	
	public function GetUsername(){
		if(isset($_POST[$this->m_username])){
			return $_POST[$this->m_username];
		}
	}
	
	public function GetPassword(){
		if (isset($_POST[$this->m_password])){
			return $_POST[$this->m_password];
		}
	}
	
	public function GetPassword2(){
		if (isset($_POST[$this->m_password2])){
			return $_POST[$this->m_password2];
		}
	}
	
	public function TriedToRegister(){
		if (isset($_POST[$this->m_registerButton])){
			return true;
		}
		return false;
	}
	
	public function SuccessMessage(){
		$message = "You are now registred!";
		return $message;
	}
	
	public function WrongUsernameMessage(){
		$message = "Invalid username";
		return $message;
	}
	
	public function WrongPassword(){
		$message = "Invalid password";
		return $message;
	}
	
	public function UserExistMessage(){
		$message = "Username already exists";
		return $message;
	}
	
	
	
	
	
	
	public function isViewingRegister(){
		
		return true;
		
	}
	
	
	
}
